import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        user: null,
        breadList: new Array({text:"首页", path:"/"})
    },
    mutations: {
        setUser(state, user) {
            state.user = user;
        },
        addBread(state, bread) {
            state.breadList.push(bread);
        },
        resetHomeBread(state) {
            state.breadList = new Array({text:"首页", path:"/"});
        }
    },
    actions: {
    },
    modules: {
    }
})
